package com.crm.mapper;

import com.crm.dto.ActivityDTO;

import com.crm.dto.AddUpActivityDTO;
import com.crm.pojo.Activity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 活动管理 请求层
 */
@Mapper
public interface ActivityMapper {


    /**
     * 分页查询
     * @param dto
     * @return
     */

    List<Activity> getActivity(ActivityDTO dto);

    /**
     * 新增活动
     * @param activity
     */
    void addActivity(Activity activity);

    //更新活动
    int updateActivity(Activity activity);


    //根据id查活动
    @Select("select * from tb_activity where id=#{id}")
    Activity getByid(Integer id);

    //根据id删除
    @Delete("delete from tb_activity where id=#{activityId};")
    void delete(Integer activityId);

  @Select("select * from tb_activity where  channel=#{channel}")
    List<Activity> queryList(String channel);
}
